import React from 'react'
import { Rate } from 'antd';
import { Link } from 'react-router-dom'

import styles from './goodsItem.scss'

export default class GoodsItem extends React.Component {
    constructor(props) {
        super(props)
        this.state = {}
    }

    render() {
        return <Link to={`/goods/detail/${this.props.goods_id}`}>
            <div className={styles.box}>
                <img className={styles.img} src={this.props.goods_small_logo ? this.props.goods_small_logo : 'https://api-hmugo-web.itheima.net/full/54af1b428dab75fbb19e0f0602db2fb288ae77b9.jpg'} alt="" />
                <h4 className={styles.name} title={this.props.goods_name}>{this.props.goods_name}</h4>
                <h4>价格：{this.props.goods_price}</h4>
                <h4>数量：{this.props.goods_number}</h4>
                <h4>重量：{this.props.goods_weight}</h4>
                <Rate disabled defaultValue={4} />
            </div>
        </Link>

    }
    
}